<template>
  <div class="home-container">
    <el-container>
        <el-header>
          <!-- 主页图标 -->
          <div>
            <img src="../assets/images/home.png" alt="">
          </div>
          <!-- 主页标题 -->
          <h4>电商后台管理系统</h4>
          <el-button type="info" @click="logout" class="logout">退出</el-button>
        </el-header>
        <el-container>
            <el-aside :style="{width: isCollapse ? '65px' : '200px'}">
              <div class="colapsse" @click="isCollapse = !isCollapse">|||</div>
              <el-menu :collapse="isCollapse" :collapse-transition="false" background-color="#333744" text-color="#fff" active-text-color="#ffd04b" :unique-opened="true" :router="true">
                <el-submenu :index="(i+1).toString()" v-for="(item, i) in homedata" :key="item.id" :style="{width: isCollapse ? '65px' : '200px'}">
                  <template slot="title">
                    <i :class="['iconfont',iconList[i]]"></i>
                    <span>{{item.authName}}</span>
                  </template>
                    <el-menu-item :index="subitem.path" v-for="subitem in item.children" :key="subitem.id"><i class="el-icon-menu"></i>{{subitem.authName}}</el-menu-item>
                  </el-submenu>
              </el-menu>
            </el-aside>
            <el-main>
              <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
  </div>
</template>
<script>
import mix from '../mixins/home-mixin'
export default {
  mixins: [mix]
}
</script>
<style lang="less" scoped>
.home-container {
  .logout {
    float: right;
    margin: 10px;
  }
  height: 100%;
  .el-container {
    height: 100%;
    .el-menu {
      background-color: #333744;
    }
    .colapsse {
      line-height: 30px;
      background-color: #aeb9bc;
      cursor: pointer;
      text-align: center;
      color: #fff;
      font-size: 9;
    }
    .el-header {
      padding: 0;
      background-color: #373d41;
      img {
        float: left;
      }
      h4 {
        float: left;
        color: #fff;
        font-size: 12;
        font-weight: 200;
        margin-left: 10px;
      }
    }
    .el-aside {
      background-color: #333744;
      user-select: none;
      font-size: 12px;
    }
  }
}
</style>
